/**
 * 
 */
package com.program.spring.test.dao;

import java.util.Collection;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

import pojo.Ad;

/**
 * @package com.program.spring.bingo.module.home.dao
 * @File    HomeDao.java
 * @Author：苏赞 
 * @CreateTime：2011-11-18上午09:12:27
 */
@Repository("BingoHomeDao")
@Scope("prototype")
public class BingoHomeDao {

	@Resource
	public HibernateTemplate template;
	
	public Collection<Ad> test(){
		
		String hql ="from Ad";
		
		List<Ad> list = template.find(hql);
		
		for(Ad obj : list){
			System.out.println(obj.getTitle());
		}
		//logger.info(hql);
		
		//return "丁华带我们去东莞";
		
		String testhql = "from Ad where title like '%李%'" ;
		
		List<Ad> list2 = template.find(testhql);
		
		for(Ad obj: list2){
			System.out.println(obj.getTitle());
		}
		
		return list;
	}
	
	
	
	
}
